/**
 * 
 */
package com.dalonedrow.module.hq.rpg;

import com.dalonedrow.globalvariables.constants.hq.GlobalConstants;
import com.dalonedrow.rpg.base.flyweights.IOPCData;

/**
 * @author Donald
 */
public final class HQCharacter extends IOPCData {
	/** the character's base Attack score. */
	private float	baseAttack;
	/** the character's base Body score. */
	private float	baseBody;
	/** the character's base Defend score. */
	private float	baseDefend;
	/** the character's base MaxBody score. */
	private float	baseMaxBody;
	/** the character's base MaxMind score. */
	private float	baseMaxMind;
	/** the character's base Mind score. */
	private float	baseMind;
	/** the character's base Movement score. */
	private float	baseMovement;
	/** the direction the pc is facing. */
	private int		directionFacing;
	/** the full value of the character's Attack score. */
	private float	fullAttack;
	/** the full value of the character's Body score. */
	private float	fullBody;
	/** the full value of the character's Defend score. */
	private float	fullDefend;
	/** the full value of the character's MaxBody score. */
	private float	fullMaxBody;
	/** the full value of the character's MaxMind score. */
	private float	fullMaxMind;
	/** the full value of the character's Mind score. */
	private float	fullMind;
	/** the full value of the character's Movement score. */
	private float	fullMovement;
	/** flag indicating whether the character can cast magic. */
	private boolean	isMagician;
	/**
	 * the value of the modifier applied to the character's base Attack score.
	 */
	private float	modAttack;
	/** the value of the modifier applied to the character's base Body score. */
	private float	modBody;
	/**
	 * the value of the modifier applied to the character's base Defend score.
	 */
	private float	modDefend;
	/** the value of the modifier applied to the character's base MaxBody score. */
	private float	modMaxBody;
	/** the value of the modifier applied to the character's base MaxMind score. */
	private float	modMaxMind;
	/** the value of the modifier applied to the character's base Mind score. */
	private float	modMind;
	/**
	 * the value of the modifier applied to the character's base Movement score.
	 */
	private float	modMovement;
	/** the spells the character has available for casting. */
	private int		spellsAvailable;
	/** the character's sprite reference id. */
	private int		spriteRef;
	/** Package protected constructor. */
	public HQCharacter() {
		super.initEquippedItems(GlobalConstants.MAX_EQUIPED);
	}
	/**
	 * Adds a spell available for casting.
	 * @param spell the spell
	 */
	public void addSpellAvailable(final long spell) {
		spellsAvailable |= spell;
		super.notifyWatchers();
	}
	/**
	 * Adjusts the score modifier for the Attack ability by a certain amount.
	 * @param val the modifier applied
	 */
	public void adjModAttack(final float val) {
		modAttack += val;
	}
	/**
	 * Adjusts the score modifier for the Body ability by a certain amount.
	 * @param val the modifier applied
	 */
	public void adjModBody(final float val) {
		modBody += val;
	}
	/**
	 * Adjusts the score modifier for the Defend ability by a certain amount.
	 * @param val the modifier applied
	 */
	public void adjModDefend(final float val) {
		modDefend += val;
	}
	/**
	 * Adjusts the score modifier for the MaxBody ability by a certain amount.
	 * @param val the modifier applied
	 */
	public void adjModMaxBody(final float val) {
		modMaxBody += val;
	}
	/**
	 * Adjusts the score modifier for the MaxMind ability by a certain amount.
	 * @param val the modifier applied
	 */
	public void adjModMaxMind(final float val) {
		modMaxMind += val;
	}
	/**
	 * Adjusts the score modifier for the Mind ability by a certain amount.
	 * @param val the modifier applied
	 */
	public void adjModMind(final float val) {
		modMind += val;
	}
	/**
	 * Adjusts the score modifier for the Movement ability by a certain amount.
	 * @param val the modifier applied
	 */
	public void adjModMovement(final float val) {
		modMovement += val;
	}
	/**
	 * {@inheritDoc}
	 */
	@Override
	public void clearModAbilityScores() {
		modAttack = 0;
		modBody = 0;
		modDefend = 0;
		modMind = 0;
		modMovement = 0;
		modMaxBody = 0;
		modMaxMind = 0;
	}
	/** Clears all spells that are available for casting. */
	public void clearSpellsAvailable() {
		spellsAvailable = 0;
	}
	/**
	 * Gets the character's base Attack score.
	 * @return <code>float</code>
	 */
	public float getBaseAttack() {
		return baseAttack;
	}
	/**
	 * Gets the character's base Body score.
	 * @return <code>float</code>
	 */
	public float getBaseBody() {
		return baseBody;
	}
	/**
	 * Gets the character's base Defend score.
	 * @return <code>float</code>
	 */
	public float getBaseDefend() {
		return baseDefend;
	}
	/**
	 * Gets the character's base MaxBody score.
	 * @return <code>float</code>
	 */
	public float getBaseMaxBody() {
		return baseMaxBody;
	}
	/**
	 * Gets the character's base MaxMind score.
	 * @return <code>float</code>
	 */
	public float getBaseMaxMind() {
		return baseMaxMind;
	}
	/**
	 * Gets the character's base Mind score.
	 * @return <code>float</code>
	 */
	public float getBaseMind() {
		return baseMind;
	}
	/**
	 * Gets the character's base Movement score.
	 * @return <code>float</code>
	 */
	public float getBaseMovement() {
		return baseMovement;
	}
	/**
	 * Gets the the direction the pc is facing.
	 * @return <code>int</code>
	 */
	public int getDirectionFacing() {
		return directionFacing;
	}
	/**
	 * Gets the full value of the character's Attack score.
	 * @return <code>float</code>
	 */
	public float getFullAttack() {
		return fullAttack;
	}
	/**
	 * Gets the full value of the character's Body score.
	 * @return <code>float</code>
	 */
	public float getFullBody() {
		return fullBody;
	}
	/**
	 * Gets the full value of the character's Defend score.
	 * @return <code>float</code>
	 */
	public float getFullDefend() {
		return fullDefend;
	}
	/**
	 * Gets the full value of the character's MaxBody score.
	 * @return <code>float</code>
	 */
	public float getFullMaxBody() {
		return fullMaxBody;
	}
	/**
	 * Gets the full value of the character's MaxMind score.
	 * @return <code>float</code>
	 */
	public float getFullMaxMind() {
		return fullMaxMind;
	}
	/**
	 * Gets the full value of the character's Mind score.
	 * @return <code>float</code>
	 */
	public float getFullMind() {
		return fullMind;
	}
	/**
	 * Gets the full value of the character's Movement score.
	 * @return <code>float</code>
	 */
	public float getFullMovement() {
		return fullMovement;
	}
	/**
	 * Gets the value of the modifier applied to the character's base Attack
	 * score.
	 * @return <code>float</code>
	 */
	public float getModAttack() {
		return modAttack;
	}
	/**
	 * Gets the value of the modifier applied to the character's base Body
	 * score.
	 * @return <code>float</code>
	 */
	public float getModBody() {
		return modBody;
	}
	/**
	 * Gets the value of the modifier applied to the character's base Defend
	 * score.
	 * @return <code>float</code>
	 */
	public float getModDefend() {
		return modDefend;
	}
	/**
	 * Gets the value of the modifier applied to the character's base MaxBody
	 * score.
	 * @return <code>float</code>
	 */
	public float getModMaxBody() {
		return modMaxBody;
	}
	/**
	 * Gets the value of the modifier applied to the character's base MaxMind
	 * score.
	 * @return <code>float</code>
	 */
	public float getModMaxMind() {
		return modMaxMind;
	}
	/**
	 * Gets the value of the modifier applied to the character's base Mind
	 * score.
	 * @return <code>float</code>
	 */
	public float getModMind() {
		return modMind;
	}
	/**
	 * Gets the value of the modifier applied to the character's base Movement
	 * score.
	 * @return <code>float</code>
	 */
	public float getModMovement() {
		return modMovement;
	}
	/**
	 * Gets the character's sprite reference id.
	 * @return <code>int</code>
	 */
	public int getSpriteRef() {
		return spriteRef;
	}
	/**
	 * Determines if the {@link IOPCData} has a spell available for casting.
	 * @param spell the spell
	 * @return true if the {@link IOPCData} has the spell available for casting;
	 *         false otherwise
	 */
	public boolean hasSpellsAvailable(final long spell) {
		return (spellsAvailable & spell) == spell;
	}
	/**
	 * Gets the flag indicating whether the character can cast magic.
	 * @return {@link boolean}
	 */
	public boolean isMagician() {
		return isMagician;
	}
	/**
	 * Determines if the character can cast spells at the moment, not merely if
	 * they are a magic-user.
	 * @return true if the player can cast spells, false otherwise
	 */
	public boolean canCastSpells() {
		return  (isMagician && spellsAvailable > 0);
	}
	/**
	 * Removes an spell available for casting.
	 * @param spell the spell
	 */
	public void removeSpellAvailable(final long spell) {
		spellsAvailable &= ~spell;
	}
	/**
	 * Sets the character's base Attack score.
	 * @param val the new value
	 */
	public void setBaseAttack(final float val) {
		baseAttack = val;
	}
	/**
	 * Sets the character's base Body score.
	 * @param val the new value
	 */
	public void setBaseBody(final float val) {
		baseBody = val;
	}
	/**
	 * Sets the character's base Defend score.
	 * @param val the new value
	 */
	public void setBaseDefend(final float val) {
		baseDefend = val;
	}
	/**
	 * Sets the character's base MaxBody score.
	 * @param val the new value
	 */
	public void setBaseMaxBody(final float val) {
		baseMaxBody = val;
	}
	/**
	 * Sets the character's base MaxMind score.
	 * @param val the new value
	 */
	public void setBaseMaxMind(final float val) {
		baseMaxMind = val;
	}
	/**
	 * Sets the character's base Mind score.
	 * @param val the new value
	 */
	public void setBaseMind(final float val) {
		baseMind = val;
	}
	/**
	 * Sets the character's base Movement score.
	 * @param val the new value
	 */
	public void setBaseMovement(final float val) {
		baseMovement = val;
	}
	/**
	 * Sets the the direction the pc is facing.
	 * @param val the direction the pc is facing
	 */
	public void setDirectionFacing(final int val) {
		directionFacing = val;
	}
	/**
	 * Sets the full value of the character's Attack score.
	 * @param val the new value
	 */
	public void setFullAttack(final float val) {
		fullAttack = val;
	}
	/**
	 * Sets the full value of the character's Body score.
	 * @param val the new value
	 */
	public void setFullBody(final float val) {
		fullBody = val;
	}
	/**
	 * Sets the full value of the character's Defend score.
	 * @param val the new value
	 */
	public void setFullDefend(final float val) {
		fullDefend = val;
	}
	/**
	 * Sets the full value of the character's MaxBody score.
	 * @param val the new value
	 */
	public void setFullMaxBody(final float val) {
		fullMaxBody = val;
	}
	/**
	 * Sets the full value of the character's MaxMind score.
	 * @param val the new value
	 */
	public void setFullMaxMind(final float val) {
		fullMaxMind = val;
	}
	/**
	 * Sets the full value of the character's Mind score.
	 * @param val the new value
	 */
	public void setFullMind(final float val) {
		fullMind = val;
	}
	/**
	 * Sets the full value of the character's Movement score.
	 * @param val the new value
	 */
	public void setFullMovement(final float val) {
		fullMovement = val;
	}
	/**
	 * Sets the the flag indicating whether the character can cast magic.
	 * @param flag the flag to set
	 */
	public void setMagician(final boolean flag) {
		isMagician = flag;
	}
	/**
	 * Sets the value of the modifier applied to character's base Attack score.
	 * @param val the new value
	 */
	public void setModAttack(final float val) {
		modAttack = val;
	}
	/**
	 * Sets the value of the modifier applied to character's base Body score.
	 * @param val the new value
	 */
	public void setModBody(final float val) {
		modBody = val;
	}
	/**
	 * Sets the value of the modifier applied to character's base Defend score.
	 * @param val the new value
	 */
	public void setModDefend(final float val) {
		modDefend = val;
	}
	/**
	 * Sets the value of the modifier applied to character's base MaxBody score.
	 * @param val the new value
	 */
	public void setModMaxBody(final float val) {
		modMaxBody = val;
	}
	/**
	 * Sets the value of the modifier applied to character's base MaxMind score.
	 * @param val the new value
	 */
	public void setModMaxMind(final float val) {
		modMaxMind = val;
	}
	/**
	 * Sets the value of the modifier applied to character's base Mind score.
	 * @param val the new value
	 */
	public void setModMind(final float val) {
		modMind = val;
	}
	/**
	 * Sets the value of the modifier applied to character's base Movement
	 * score.
	 * @param val the new value
	 */
	public void setModMovement(final float val) {
		modMovement = val;
	}
	/**
	 * Sets the character's sprite reference id.
	 * @param val the reference id to set
	 */
	public void setSpriteRef(final int val) {
		spriteRef = val;
	}
}
